/**
 * Created by gek on 2016/3/21.
 */
var controllers = angular.module('ngControllers', []);

controllers.controller('newsController', function () {

});

controllers.controller('homeController', function (Brief) {

});

controllers.controller('joinController', function () {

});

controllers.controller('loginController', function ($rootScope, $scope) {
  $scope.load = function () {
    $rootScope.go('/admin/login');
    //$rootScope.loadState = true;
  }
});

controllers.controller('defaultPageController', function ($rootScope, $scope) {

});
controllers.controller('adminNewsController', function ($rootScope, $scope) {

});

controllers.controller('joinController', function ($rootScope, $scope, CityList, Join) {
  window.scrollTo(0, 0);
  $scope.hasSend = false;
  $scope.newJoin = {};
  $scope.division = CityList();
  $scope.sendMsg = function () {
    $scope.newJoin.city = $scope.city;
    $scope.newJoin.province = $scope.province;
    Join.add({},$scope.newJoin, function (res) {
      $scope.hasSend = true;
    }, function (err) {
      alert(err.data.msg);
    })
  };
});

controllers.controller('managerController', function ($rootScope, $scope) {

});


